
/**
 * @Project : Clion_ProgrammingExercises
 * @File : 0868
 * @Author : WangRuoyu 
 * @Date : 2023/5/23 16:00
 */

#include "iostream"

using namespace std;

int main() {
    int n;
    scanf("%d", &n);
    int primes[n + 10];
    bool st[n + 10];
    int cnt = 0;

    for (int i = 0; i <= n; ++i) {
        primes[i] = 0;
        st[i] = true;
    }

    for (int i = 2; i <= n; ++i) {
        if (st[i]) {
            primes[cnt++] = i;
        }
        for (int j = 0; primes[j] <= n / i; ++j) {
            st[primes[j] * i] = false;
            if (i % primes[j] == 0) break;
        }
    }

    printf("%d", cnt);

    return 0;
}